#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void found(char* left, char* right)
{
    char tmp = *left;
    while (left < right)
    {
        tmp = *left;
        *left = *right;
        *right = tmp;
        left++;
        right--;
    }
}

int main()
{
    int i = 0;
    char ch[100] = { 0 };
    gets(ch);
    int len = strlen(ch);
    found(ch, ch + len - 1);
    char* count = ch;
    char* p0 = ch;
    while (*count)
    {
        while (*count != ' ' && *count != '\0')
        {
            count++;
        }
        found(p0, count - 1);
        p0 = count + 1;
        count++;
    }

    for (i = 0; i < len; i++)
    {
        printf("%c", ch[i]);
    }
    return 0;
}